home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b1.d64
/
calender.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
2KB
|
56 lines
10 POKE53272,21:POKE53280,1:POKE53281,1:REM C64 MODS 1983 BY WIM
20 REM THIS PROGRAM WAS WRITTEN BY J.R ROSSUM
30 REM SUGGESTED BY 'JULIAN' IN THE HP BASIC LIBRARY
40 REM REVISED OCT 1979
50 PRINT"[147][144]PROGRAM TO GENERATE CALENDER"
60 PRINT:PRINT" FOR ANY MONTH "
70 PRINT:PRINT " SINCE THE BIRTH OF CHRIST"
80 CLR:DIM M$(24):T0=TI
90 PRINT:PRINT"TYPE ALL FOUR DIGITS OF DESIRED YEAR":PRINT:INPUT" ";G
100 INPUT"MONTH(1-12)";M
110 IF G<1900 THEN 180
120 D=(G-1900)*365
130 FOR Q=1901 TO G-1
140 IF Q/4=INT(Q/4) THEN D=D+1
150 NEXT
160 D=D+2
170 GOTO 260
180 PRINT "[147]YOU WILL HAVE TO WAIT A BIT FOR THAT ONE"
190 D=G*365
200 FOR Q=1 TO G-1
210 IF Q/400=INT(Q/400) THEN 230
220 IF Q/100=INT(Q/100)THEN 240
230 IF Q/4=INT(Q/4) THEN D=D+1
240 NEXT
250 D=D+1
260 PRINT"[147]JULIAN CALENDAR"
270 FOR J=1 TO 24:READ M$(J):NEXT
280 FOR J=1TO7:READ D$(J):NEXT
290 PRINT M$(2*M-1)TAB(35)G
300 PRINT:PRINT:FOR J=1 TO 7:PRINT TAB(6*(J)-6)D$(J);" ";:NEXT
310 IF G/400=INT(G/400)THEN 330
320 IF G/100=INT(G/100) THEN 340
330 IF G/4=INT(G/4) THEN M$(4)="29"
340 FOR J=2 TO 2*M-2 STEP 2:S1=S1+VAL(M$(J)):NEXT
350 IF M=1 THEN S1=0
360 S=S1+D-7*INT((S1+D)/7)
370 V=VAL(M$(2*M))
380 S=S+7:IF S>7 THEN S=S-7
390 T=1+6*(S-1):U=5
400 PRINT:PRINTTAB(T-1);
410 IF T=37 THEN 430
420 FORD=1TOV:GOTO440
430 PRINT 1:FOR D=2TOV
440 PRINT D;SPC(U-LEN(STR$(D)));
450 IF POS(0)>34 THEN U=3
460 IF POS(0)<34 THEN U=5
470 NEXT
480 PRINT:PRINT:PRINT:PRINT TAB(10)"TIME="INT((TI-T0)/36)/100 "MINUTES"
490 PRINT:INPUT "ANOTHER";K$
500 IF LEFT$(K$,1)="Y" THEN 80
510 IF LEFT$(K$,1)="N" THEN END
520 GOTO 490
530 DATA JANUARY,31,FEBUARY,28,MARCH,31,APRIL,30,MAY,31,JUNE,30,JULY,31
540 DATA AUGUST,31,SEPTEMBER,30,OCTOBER,31,NOVEMBER,30,DECEMBER,31
550 DATA SUN,MON,TUE,WED,THU,FRI,SAT,SUN